Fixed various crashes in the test suites.