Fix directory creation permission bug.