Adding support for distinct.