Google C++ style guide & static analyzer

Bringing the code into compliance with requirements of Google C++ style
guide and static analyzer. More code optimization.