fixes for newer PHP