Fix detailed printing of query matches (bnc#853167)