Name uniqueness check for graphs and components, fixes #357