Fixes for older PHP versions