Fix a number of unit tests