Sonar hunt. Fixes #82

RCI is now 97.4%, test coverage 75.3%, test line coverage 76.6%