More explicit invalid_password error message related to #266
minor code style fixes