re-reference regions during uncombine - #5979
Properly count nested regions
cleanup unused nested regions:

This and two previous commits fixes #5979