Fix mkdirs problems