Fixed code flow and deep copy bug that was breaking unweighted search (for a change)