Fixes to achieve PHP5.3 compatibility.