Fix major problems from insight.sensiolabs.com
https://insight.sensiolabs.com/projects/d96399b1-5c10-40d3-ba04-2f16f5337a88/analyses/4