fix a few static analyzer warnings