Fix thread next instruction calculation.