fix up the C bits to compile