Added duplicate name checking.