Improved logging and added test for password rest.