fix a few warnings reported by https://scrutinizer-ci.com/