WSOTWO-147: Fixed issues which were found by Sonar