Closing the dialog restores selection. Fixes #124