Fixes problems found by scrutinizer-ci