Latest fixes for OpenChange integration

Some fixes to contribute after some refactor in our branches. From now on we will be doing this more frequently so it will be easier to review and merge.