Fixed a bug when handling controller authentication.