Fix incorrect sorting; check vocab words in dictionary