Fixed problem where directory wouldn't be created on some plateforms