Updated to improve validation.