Made tests more robust