Permission fixes and endline fixes