Some tweaks to support more convoluted test scenarios.