Bug fix in octree, tests