Some fixes for 2.4 compatibility.