Bug fixing in TP visitor