Fixes for authentication