Rewrite tuples should fix types of errors