Merge remaining Zentyal changes to openchange master and gets everything sync'ed

Update formating and add parenthesis for every comparison