Move rendering search results into helper fn.
Fix rendering bug.