ToUpstream: Various backend improvements