Search method

Some minor fixes. It looks like a lot of this may have been previously merged.