Assorted C-plugin patches

Intended for merge after the catchup.  Hopefully Github will automatically adjust this request so that it'll be just 14 commits rather than 143.