Fix changing from salted to non-salted passwords, and vice versa

The first two commits update tests to correctly demonstrate the failing existing behavior. The final commit fixes the issue.