MNT: Fixed bugs in type/value validation in search()