Fix mkdirs problems
Merge pull request #7 from Thog92/fix-mkdirs

Fix mkdirs problems