Fixes problems uncovered by scrutinizer-ci