Bug fixes for authentication callbacks