Partially fix #185.
This fix applies to functions, but not types.
The added test fails without the cfacpp changes.