diff --git a/pgadmin/include/utils/misc.h b/pgadmin/include/utils/misc.h
index 5e54ac2..80255ae 100644
--- a/pgadmin/include/utils/misc.h
+++ b/pgadmin/include/utils/misc.h
@@ -129,8 +129,6 @@ void CheckOnScreen(wxWindow *win, wxPoint &pos, wxSize &size, const int w0 = 100
 wxString IdAndName(long id, const wxString &name);
 
 // Quoting
-wxString qtIdent(const wxString &value);    // add " if necessary
-wxString qtTypeIdent(const wxString &value);    // add " if necessary
 wxString qtDbStringDollar(const wxString &value);
 wxString qtStrip(const wxString &value);    // remove \"
 
@@ -257,5 +255,9 @@ wxString sanitizePath(const wxString &path);
 wxString commandLineCleanOption(const wxString &option, bool schemaObject = false);
 #endif // PGSCLI
 
+// Quoting
+wxString qtIdent(const wxString &value);    // add " if necessary
+wxString qtTypeIdent(const wxString &value);    // add " if necessary
+
 #endif
 
diff --git a/pgadmin/utils/misc.cpp b/pgadmin/utils/misc.cpp
index 2f75d94..7955cfe 100644
--- a/pgadmin/utils/misc.cpp
+++ b/pgadmin/utils/misc.cpp
@@ -42,6 +42,10 @@
 // App headers
 #include "frm/frmMain.h"
 
+wxImageList *imageList = 0;
+
+#endif // PGSCLI
+
 extern "C"
 {
 #define YYSTYPE_IS_DECLARED
@@ -50,10 +54,6 @@ extern "C"
 #include "parser/keywords.h"
 }
 
-wxImageList *imageList = 0;
-
-#endif // PGSCLI
-
 // we dont have an appropriate wxLongLong method
 #ifdef __WIN32__
 #define atolonglong _atoi64
@@ -332,6 +332,7 @@ void FillKeywords(wxString &str)
 	}
 }
 
+#endif // PGSCLI
 
 static bool needsQuoting(wxString &value, bool forTypes)
 {
@@ -385,7 +386,6 @@ static bool needsQuoting(wxString &value, bool forTypes)
 	return true;
 }
 
-
 wxString qtTypeIdent(const wxString &value)
 {
 	if (value.Length() == 0)
@@ -419,6 +419,7 @@ wxString qtIdent(const wxString &value)
 		return result;
 }
 
+#if !defined(PGSCLI)
 
 wxString qtStrip(const wxString &str)
 {
diff --git a/xtra/pgscript/lib/Makefile.am b/xtra/pgscript/lib/Makefile.am
index 4d90865..7294b42 100644
--- a/xtra/pgscript/lib/Makefile.am
+++ b/xtra/pgscript/lib/Makefile.am
@@ -11,7 +11,7 @@ noinst_LIBRARIES = libpgs.a
 
 nodist_libpgs_a_SOURCES = $(srcdir)/../../../pgadmin/utils/sysLogger.cpp \
 	$(srcdir)/../../../pgadmin/utils/misc.cpp \
-	$(srcdir)/../../../pgadmin/utils/md5.cpp \
+	$(srcdir)/../../../pgadmin/db/keywords.c \
 	$(srcdir)/../../../pgadmin/pgscript/utilities/pgsUtilities.cpp \
 	$(srcdir)/../../../pgadmin/pgscript/utilities/pgsThread.cpp \
 	$(srcdir)/../../../pgadmin/pgscript/utilities/pgsMapm.cpp \
