#29 Cleaned up some of the search code.