Fixed a few bugs that the unit tests filtered out