Fix bugs reported found in initial testing.