SensioLabs Insight fixes

... as per https://insight.sensiolabs.com/projects/ffe7f88f-648e-4ad8-b809-31ff4fead16a/analyses/57.