[JIRA 1168] Modified to obey style guide. If statement had missing braces.
[JIRA 1168] Added new tests.