Fixed various bugs with the testbench.