Updated with suggested pull request changes.

- Overrode setText method.
- Enclosed if branches in braces.
- Check for primitive operation.