Fixed performance regression in bvh