Fixes a number of errors in the testing, not the tested code.