Fixed tests when running with sonar