Fix obscure undojoin bug