quick php compatibility fixes for 5.4 - still broken