Several code analyzer warnings fixed