minor fixes to random pathname code.