Formatting changes and code review updates.

Correct some code formatting and tweak some of the security rules that although equivalent to the drools rule, were incorrect in terms of business logic.