Additional error checking added to ccode.c C_RecordStat()