migrate some fixes over from Trusty