Fix errors in C code

I thought I had run the test correctly, but not on the right branch. Hope it works this time.