Fix issues when validating AD login credentials.