diff --git a/pub/CMakeLists.txt b/pub/CMakeLists.txt
index 07f2d422aca4742d0fbcb08a28442df7dead0aec..ce4f7857eac73976675109d79a0b41ca856115c5 100644
--- a/pub/CMakeLists.txt
+++ b/pub/CMakeLists.txt
@@ -20,7 +20,7 @@ set(Frida_VERSION post-2.2.2b)
 #option(FRIDA_MAN "Build a user manual" OFF)
 #option(BUILD_DEBIAN "Build a debian package" OFF)
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -pedantic -Wall -Wno-sign-compare -Wno-unused-result -Wno-parentheses -Werror")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fext-numeric-literals -g -pedantic -Wall -Wno-sign-compare -Wno-unused-result -Wno-parentheses -Werror")
 
 find_package(OpenMP)
 if (OPENMP_FOUND)
diff --git a/pub/lib/fbase.cpp b/pub/lib/fbase.cpp
index 2555ba3dae07bdcc19200bae63723f8312f20023..e85ee4eb7a3d3bd1b3bb6ea7a6f8f3af2c2c7e61 100644
--- a/pub/lib/fbase.cpp
+++ b/pub/lib/fbase.cpp
@@ -12,11 +12,14 @@
 #include <map>
 #include <vector>
 #include <cstdlib>
+#include <complex.h>
 #include <gsl/gsl_sf.h>
 
 #include <../trivia/rng.hpp>
 #include <kww.h>
 #include <cerf.h>
+#include <math.h>
+#include </G/libcerf/lib/defs.h>
 
 #include "defs.hpp"
 #include "func.hpp"
@@ -127,6 +130,11 @@ double func_erfP(double v) { return 1-gsl_sf_erf_Q(v); }
 double func_erfQ(double v) { return gsl_sf_erf_Q(v); } 
 double func_erf(double v) { return gsl_sf_erf(v); } 
 double func_erfc(double v) { return gsl_sf_erfc(v); } 
+double func_erfi(double v) { return erfi(v); } 
+
+double func_cerfi_re(double x, double y) {
+    double _Complex zz = x + y*_Complex_I;
+    return creal(cerfi(zz)); }
 
 double func_dawson(double v) { return gsl_sf_dawson(v); }
 
@@ -515,6 +523,10 @@ void fbase_initialize(void)
     G->register_fct_d_d  ( "erf", func_erf );
     G->register_fct_meta ( "erfc", 1, "(x): complementary error function of x" );
     G->register_fct_d_d  ( "erfc", func_erfc );
+    G->register_fct_meta ( "erfi", 1, "(x): imaginary error function of x" );
+    G->register_fct_d_d  ( "erfi", func_erfi );
+    G->register_fct_meta ( "cerfi_re", 2, "(x,y): real part of complex error function of x+iy" );
+    G->register_fct_d_dd ( "cerfi_re", func_cerfi_re );
     G->register_fct_meta ( "dawson", 1, "(x): Dawson function of x" );
     G->register_fct_d_d  ( "dawson", func_dawson );
     G->register_fct_meta ( "sinc", 1, "(x): sinus cardinalis, sin(x)/x" );
diff --git a/pub/lib/olf.cpp b/pub/lib/olf.cpp
index 630e28ceb043d0c2b3e5130f72527ff4710e9aff..33bd2aa46b7d99f1936e5eae92dcfc7ed9601c34 100644
--- a/pub/lib/olf.cpp
+++ b/pub/lib/olf.cpp
@@ -382,7 +382,8 @@ void COlc::curve_val_vec_expr( vector<double>* v, vector<double>* dv,
         if ( RObjVecDbl pv = PCAST<const CObjVecDbl>(val) ) {
             *v = pv->v;
             if( dv )
-                *dv = PCAST<const CObjVecEnu>(val)->dv;
+                if( auto pdv = PCAST<const CObjVecEnu>(val) )
+                    *dv = pdv->dv;
         } else
             throw "BUG: curve_val_vec_expr did not get vectorial result";
     }