Fix magit-ediff and magit-visit-item bugs