Corrected a bug with the TCS output writing.