Fixed password matching and added a valid email check.