some minor fixes to make tests more robust