provide where_values (and other *_values) within scope

The change in #4021 reset the where_values and other related values when creating a scope. Instead I've uniqued the values within the merge method.