Fixing search. Closes #127
Cleaning up some dead code