various C-related cleanups