Correct error handling, correct password handling,
various bug fixes.