Updated functions relating to setting up test environment.