Fix some error testing in unit tests.