Re-add 2.4 compat fix accidentally removed in old code prune