Fixes bug that only the last item in search criteria is used

Part of OOIION-1538
Merge pull request #108 from Bobfrat/ooiion1538

Fixes bug that only the last item in search criteria is used