Add a max depth bound to the bfs implementation in cvReconstructType,