Handle error case  where no merge info is returned by QueryMerges

rebase of the work made in #628.

Need a test by someone that has the error....