Fixed a bug that can cause edge flags to be set wrong in initial traversal; performance bug still left to fix: -g flag is active