Fix level issues suggested by sonar