Correcting some bugs that were breaking the tests.