Some fixes to get exp working in php v5.2 again