Fixes to run at old PHP versions