add pruning test & improve logging & py3k fix