Small bugfix when creating directories