Fix authenticate() behaviour