Fix some PHP 5.4 (and higher) issues