Fix problems found when running regression tests.