fix bug caused by type checking function bodies when extracting bindings
slightly less broken support for type Option<T> etc