Return correct error on name collision when creating new named objects. Check for correct error in affected places.