Remove useless duplicates