Fixed minor bug in authentication