Fixed mkdir function.