minor fixes for php5.3