Fixed BFS to return correct solutions.