Password authentication tests and related fixes