Fix metadata directory perms