Use consistent strategy for generating test env.
Part of fixing #111