Fix problem when argument type and return type mismatches but are the same variable (#409)