Sonar and RC Updates

Bug Fixes and Standard Compliance changes for RC and Sonar. Initialize
in main function.