Made test more robust