Fix BFS predecessor logic [See #34]