fix some error reporting stuff for php5.4