More unit tests and some changes to fix Sonar complaints
More unit tests and some changes to fix Sonar complaints