add kernel branch emulation fix from #1345