Fixing sonar major issues