Tweaks for py2exe compatibility.