Fix os arg in xxx_dir() functions

See hadley#8 for discussion