Merge pull request #2347 from simonwelsh/3.1

Scrutinizer fixes