Many fixes to profile and permission updates