Fix case for 3+ matching functions
Merge branch 'documentquery'