bug fixes to password setting code, should work fine now