fixing prunetree.py bugs