Fix some static analyzer findings