Cleaned up some comparator code