Fixed segfaults when inserting nodes into worklist. Prevented duplicate insertions of nodes into worklist.