fix up mkdirp and its uses