diff --git a/src/libdap-python.c b/src/libdap-python.c
index 56da14d5534457682a320df1bc6dd6b6a77c78dc..434431c482de8b181e79808a6c1412457ad21129 100644
--- a/src/libdap-python.c
+++ b/src/libdap-python.c
@@ -26,6 +26,7 @@ static PyObject *dap_init(PyObject *self, PyObject *args){
 }
 
 static PyObject *dap_deinit(){
+    dap_config_close(g_config);
     dap_config_deinit();
     dap_common_deinit();
     return PyLong_FromLong(0);
diff --git a/test/main_test.py b/test/main_test.py
index b4ea8e71c627e80f03b0ec30b26362a3cb1ef982..23f87b6cd9739ee4d5a9a40b0bac894e6db245eb 100644
--- a/test/main_test.py
+++ b/test/main_test.py
@@ -34,7 +34,7 @@ output_info("Outputting a string using the log_it function done")
 res1 = libdapConnector.configGetItem("server", "listen_address")
 output_info("Output [server] 'listen_address' = "+res1+"\n")
 res2 = libdapConnector.configGetItemDefault("server1", "listen_address", "8.8.8.8")
-output_info("Output default value '8.8.8.8' \n [server1] 'listen_address' = "+res2+"\n")
+output_info("Output default value '8.8.8.8' [server1] 'listen_address' = "+res2+"\n")
 output_info("TEST. Get default config done")
 libdapConnector.deInit()
 output_info("Deinitialization done")