Fixing mkdir function to be less platform specific