Fix parameter spotting in function types

We were only looking in the return type, not the argument types.
Fixes #1391