Updated to support new CompareRelation -- to some extent. At least backwards compatible for now.