Fixed bug in cctWrite