Fix tree traversal to skip ahead in search