Merged in port writing changes to testbench.cpp