Sonar fixes and additional tests.