LDAP testing and improvements