Modification fixes. Integrate internal ions stuff from upstream lorikeet.