Apply patch from John Keeping to fix fast-import bug