LDAP addition and bug fixes