Started fixing tests, now know how to fix all remaining. Some tests may
require to be run separately rather than as part of the suite (Any test
that hangs will pass if it is rerun separately).