Misc changes to cope with compiling code containing foreign decls that also causes C stubs to be gen'ed