minor fixes to make C semantics work more correctly

@andreistefanescu @yilongli please review
I don't understand this but I guess it doesn't matter