Fixes proposed by SensioLabs Insight