Backport #541 fix in 2.4 (for 2.4.3)