Fix a couple of bugs in test queue