Various fixes to models and tests so all tests pass. Move two tests to wip that need substantial work.