Fix most of the errors reported by SensioLabs Insight