Adds search result anding

This is the minimal fix for the bug part of #77.