Fixes problems uncovered by scrutinizer-ci
Merge pull request #765 from nsendetzky/master

Fixes problems uncovered by scrutinizer-ci