Improved compatibility with older PHP versions