Fixed issues with comparator and similarity measurer