Many changes, mostly unit tests.