Federation & LDAP related fixes