Fix resolving of functions in type declarations.