Fixed if statements in treetap.