Fixed a bug when creating multiple new folders/files in the same directory.
Fixes #294.