fix some static analyzer warnings