Fixes bfs in init implementation