Fix issues found by SensioLabsInsight