Fixed problems adding/amending commit attrs.

- Solve problem checking for duplicated commit attributes.
- Refactored function name.
- Code review.