A few warning fixes

Also includes one static-analysis fix at no additional cost!