QA-5813: Fix Sonar and compiler warnings