Fixed issue involving method type parameter constraints

An attempt to solve #266, although I am not 100% sure. It seems that the substitution was applied twice. At least this commit solves the problem, and it does not cause any tests to fail.