diff --git a/src/config.rs b/src/config.rs
index 2486f0259d0ed9b752d7c5976d1d86db12a8d4cf..c6e4ee0503dcbbba36414c0e78625fa993de6132 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -18,7 +18,7 @@ extern crate config;
 fn load_config(config_file: String) -> config::Config {
     let mut conf = config::Config::default();
 
-    conf.set("pam.flow", "password");
+    conf.set("pam.flow", "password").ok();
 
     conf
         .merge(config::File::with_name(&config_file)).unwrap()
@@ -48,9 +48,9 @@ pub fn argv_to_config(argv: &Vec<String>) -> config::Config {
     for arg in argv {
         if arg.contains("=") {
             let split: Vec<&str> = arg.split("=").collect();
-            conf.set(split[0], split[1]);
+            conf.set(split[0], split[1]).ok();
         } else {
-            conf.set(arg, true);
+            conf.set(arg, true).ok();
         }
     }
     return conf;
diff --git a/src/pam.rs b/src/pam.rs
index 47d7269c263026609096cbba2fd7db3c25efe0b7..5edea9f3ebf02246e066d03858fb2e75c5d1df2c 100644
--- a/src/pam.rs
+++ b/src/pam.rs
@@ -46,7 +46,7 @@ fn get_or_pam_error(config: &Config, key: &str) -> Result<String, PamError> {
             debug!("Configuration key found: {} = {}", key, v);
             return Ok(v);
         },
-        _ => {
+        Err(_) => {
             error!("Configuration key not found: {}", key);
             return Err(PamError::SERVICE_ERR);
         },