add assert for not getting bad out regs, and fix some bugs related to this