MISRA C 2012 Compliance Work

Adjusted for brace requirements, required return statements in void
functions and other general formatting.