FIX: small bugfix for functions that reuse a type variable