Further tests and fixes for the new tree iterator