Fix invalid read valgrind error when printing tuples