ToUpstream: Make extsd workaround a bit more universal