Fix a few errors from BFS patch