Fix issues found by SensioLabsInsight & Scrutinizer-CI