Minor edits to test setup and supporting functions.