Fix Unauthorized error behaviour.