Fix tests, and problems found by tests