--- a/src/qtgui/rclmain_w.cpp
+++ b/src/qtgui/rclmain_w.cpp
@@ -324,6 +324,11 @@
 	    this, SLOT(eraseDocHistory()));
     connect(fileEraseSearchHistoryAction, SIGNAL(triggered()), 
 	    this, SLOT(eraseSearchHistory()));
+    connect(actionSave_last_query, SIGNAL(triggered()),
+	    this, SLOT(saveLastQuery()));
+    connect(actionLoad_saved_query, SIGNAL(triggered()),
+	    this, SLOT(loadSavedQuery()));
+
     connect(helpAbout_RecollAction, SIGNAL(triggered()), 
 	    this, SLOT(showAboutDialog()));
     connect(showMissingHelpers_Action, SIGNAL(triggered()), 
@@ -1077,6 +1082,9 @@
 {
     if (asearchform == 0) {
 	asearchform = new AdvSearch(0);
+        if (asearchform == 0) {
+            return;
+        }
 	connect(new QShortcut(quitKeySeq, asearchform), SIGNAL (activated()), 
 		this, SLOT (fileExit()));