Some client fixes to make the unit tests more reliable