Fixed a bunch of unittests.