Fix some tests failing in older PHP versions