Fixed several issues with C header generation