Fix more bugs with search criteria.

Fuck, this requires a unit test. Why the fuck am I not writing the,.