Fix a bunch of unit tests