Corrected wrong usage of search dialog. Fixes #312