Some more permissions checking and corrections