ENG-6122 More cleanup and a uniqueness fix