Fixes for analyzer warnings