backported emperor fixes from 2.1