Fixes for authentication and permissions