Added ThreadSafetyCompare from last commit, and made minor changes
to TraversalKind.