various fixes from #2748491