backport changes and fixes from umtrx branch