Fixed a number of bugs in the hybrid bfs stepwise algorithm