Fixes incorrect join type for search
Cleaned up the (still bad) search method