Finish of implementation of nonunique region id.

- fix error in add_region method
- add unit test