diff --git a/scripts/configure.pl b/scripts/configure.pl
index 5f0fb2b13815bd257c3bb7f79b498d7437a1cd80..20021b85a0ce149055e84e6f753543f4e572601a 100755
--- a/scripts/configure.pl
+++ b/scripts/configure.pl
@@ -12,10 +12,10 @@ sub add_config {
     foreach my $key (keys $c) {
 	my $val = $c->{$key};
 
-	if (ref($val)) {
+	if (ref($val) eq 'HASH') {
 	    add_config($key . '.', $val);
 	}
-	else {
+	unless (ref($val)) {
 	    $config{'@' . $prefix . $key . '@'} = $val;
 	}
     }