Remove cg file before re-creating and appending to it.