Quality improvements

Repository now scanned using Sonar and quality improvements have been
made.  More improvements will be made going forwards.