Some undo fixes, but still some breakage left in there in certain situations..