Fix a couple of bugs in the testing process