Fixed several bugs. Another bug in the process BFS has surfaced