Some C code tidying