Fix 2.4 compatibility issues