Bug fix, updates, add select distinct (@see doc)