Fix directories locations and permissions