Fixed an error with instantiating parametric types given as function params and nested inside other types