Fix checking for invalid password types