Fix password-reset bugs