Several tweaks for ios compatibility.