Fixed bug with empty password. Fixed error message handling.