added new LDAP tests and improved some function