Fix a couple critical bugs on the test suite