Fix crash on search before sync is complete
Remove unused using statement
Merge pull request #3186 from pboyer/PkgSearchCrashFix074

Cross-merge MAGN-5442 to RC0.7.4