Uniqueness fixes

These make 'where' and metavariables work better with unique values