Fixed the permission bug with mkdir (issue #31)