Login, authorization fixes