Fixed comparator bug