Fix bugs found while working on graph/set changes

This will be a significant argument for the comming change list; that is
that the keys should be int rather than interface{}. These three bugs
were found because of that change.