Improved Time machine logic for tests.