Fixes for ldap module authenticate! method