diff --git a/SConstruct b/SConstruct
index 466f52069c800e012bbf4bafb054e2c176029e9d..dfe70903195a65d899d1425e40cf4c5b90468a5c 100644
--- a/SConstruct
+++ b/SConstruct
@@ -387,8 +387,8 @@ env = Environment(tools = ['default', 'textfile'] + [config['fortran_tool']],
                   F90FLAGS = config['f90_flags'] + config['generic_optimisation'],
                   LINKFLAGS = config['link_flags'],
                   LIBPATH = [config['generic_lib_dir']],
-                  DOLLAR = '\$$',
-                  RPATH = [HashableLiteral('\$$ORIGIN')],
+                  DOLLAR = '\\$$',
+                  RPATH = [HashableLiteral('\\$$ORIGIN')],
                   F90 = config['fortran_compiler'],
                   FORTRAN = config['fortran_compiler'],
                   CC = config['cc'])
@@ -691,7 +691,7 @@ for (loops, process_api, processlib) in process_list:
         processes_seen[processlib] = loops
 process_list = process_list_nodup
 
-env.Append(RPATH = [HashableLiteral('\$$ORIGIN/../lib')])
+env.Append(RPATH = [HashableLiteral('\\$$ORIGIN/../lib')])
 
 
 for (loops, process_api, processlib) in process_list:
@@ -768,7 +768,7 @@ for (loops, process_api, processlib) in process_list:
             env = env,
             shared = config['shared_libraries'],
             env_mod = [
-              ('^(virtual_\d|tensorsum_|loop_)',
+              ('^(virtual_\\d|tensorsum_|loop_)',
                {'F90FLAGS': config['f90_flags'] + config['loop_optimisation']}),
               ('',
                {'F90FLAGS': config['f90_flags'] + config['born_optimisation']})]
diff --git a/pyol/tools/OLBaseConfig.py b/pyol/tools/OLBaseConfig.py
index c2bb020a447cdd6381e6982a2f907b0f4fdff251..e09d86f3769308b2de1af97efd011789ca29966b 100644
--- a/pyol/tools/OLBaseConfig.py
+++ b/pyol/tools/OLBaseConfig.py
@@ -21,9 +21,9 @@
 import os
 import sys
 if sys.version_info.major == 2:
-    import ConfigParser as configparser
+    from ConfigParser import SafeConfigParser as CfgParser
 else:
-    import configparser
+    from configparser import ConfigParser as CfgParser
 import re
 
 # prefix for default_config_file and user_config_file
@@ -101,10 +101,13 @@ def get_config(args=[]):
           (if the same option is given more than once,
            only the last set value is used)
     """
-    config = configparser.SafeConfigParser()
+    config = CfgParser()
     # default configuration
     with open(os.path.join(prefix, default_config_file), 'r') as fh:
-        config.readfp(fh)
+        if sys.version_info.major == 2:
+            config.readfp(fh)
+        else:
+            config.read_file(fh)
     # override with user configuration
     config.read([os.path.join(prefix, user_config_file)])
     config = dict(config.items('OpenLoops'))