make ExpandStructRegs more robust