improved spacem method to handle unwritable names better (where perl was not happy...