Ensure uniqueness of nicks by adding a numerical suffix when the root nicks are not unique (up to 1000). Fixes issue #987.