Fix various static analyzer issues.