Various Evolveum fixes

Various fixes and small improvements from the Evolveum fork of ConnId