Fixing mkdir permissions (using $CFG->directorypermissions)