some php5.4 compat. fixes