Make tests more robust