Changes so it works in older PHP versions.