Fixed searching. Changes to facilitate this