Minor tweaks to make tests more robust