3.6/f/fix warnings

Rebase of a couple of warning fixes from master to 3.6/master