diff --git a/ref/common/registered_funcs.h b/ref/common/registered_funcs.h
index b278b111ea8e539725b1d145a0c41cb4adf11fb2..189fbff70f9d136fb19411667695eb0467126ac1 100644
--- a/ref/common/registered_funcs.h
+++ b/ref/common/registered_funcs.h
@@ -33,8 +33,6 @@ extern xc_func_info_type xc_func_info_gga_x_pbe_jsjr;
 extern xc_func_info_type xc_func_info_gga_x_pbek1_vdw;
 extern xc_func_info_type xc_func_info_gga_x_pbefe;
 extern xc_func_info_type xc_func_info_gga_x_bcgp;
-
-/*
 extern xc_func_info_type xc_func_info_gga_x_pbe_mol_genxc;
 extern xc_func_info_type xc_func_info_gga_x_pbe_tca_genxc;
 extern xc_func_info_type xc_func_info_gga_x_pbe_genxc;
@@ -44,7 +42,6 @@ extern xc_func_info_type xc_func_info_gga_x_pbe_jsjr_genxc;
 extern xc_func_info_type xc_func_info_gga_x_pbek1_vdw_genxc;
 extern xc_func_info_type xc_func_info_gga_x_pbefe_genxc;
 extern xc_func_info_type xc_func_info_gga_x_bcgp_genxc;
-*/
 
 const xc_func_info_type *xc_lda_known_funct[] = {};
 const xc_func_info_type *xc_mgga_known_funct[] = {};
@@ -58,7 +55,6 @@ const xc_func_info_type *xc_gga_known_funct[] = {
   &xc_func_info_gga_x_pbek1_vdw,
   &xc_func_info_gga_x_pbefe,
   &xc_func_info_gga_x_bcgp,
-/*
   &xc_func_info_gga_x_pbe_mol_genxc,
   &xc_func_info_gga_x_pbe_tca_genxc,
   &xc_func_info_gga_x_pbe_genxc,
@@ -68,7 +64,6 @@ const xc_func_info_type *xc_gga_known_funct[] = {
   &xc_func_info_gga_x_pbek1_vdw_genxc,
   &xc_func_info_gga_x_pbefe_genxc,
   &xc_func_info_gga_x_bcgp_genxc,
-*/
 };
 
 #endif
diff --git a/ref/main.c b/ref/main.c
index 19fdae35510339def50311767553d168ca20f322..179d4397b8a2b5004be8d9a1582b2956c74fc448 100644
--- a/ref/main.c
+++ b/ref/main.c
@@ -90,6 +90,11 @@ int main() {
   v4rhosigma3_genxc  = (double*) malloc(20*npoints*sizeof(double));
   v4sigma4_genxc     = (double*) malloc(15*npoints*sizeof(double));
   #else
+  v4rho4_libxc       = (double*) NULL;
+  v4rho3sigma_libxc  = (double*) NULL;
+  v4rho2sigma2_libxc = (double*) NULL;
+  v4rhosigma3_libxc  = (double*) NULL;
+  v4sigma4_libxc     = (double*) NULL;
   v4rho4_genxc       = (double*) NULL;
   v4rho3sigma_genxc  = (double*) NULL;
   v4rho2sigma2_genxc = (double*) NULL;
@@ -97,28 +102,6 @@ int main() {
   v4sigma4_genxc     = (double*) NULL;
   #endif
 
-  if(xc_func_init(&gga_libxc, XC_GGA_X_BCGP, XC_POLARIZED) < 0) {
-    fprintf(stderr, "XC_GGA_X_BCGP not found!\n");
-    return -1;
-  }
-
-  for(i=0; i<npoints; i++){
-    rho_libxc[2*i + 0]   = 0.048 + i/(double)(npoints);
-    rho_libxc[2*i + 1]   = 0.025;
-    sigma_libxc[3*i + 0] = 0.0046;
-    sigma_libxc[3*i + 1] = 0.0044;
-    sigma_libxc[3*i + 2] = 0.0041;
-  }
-
-  S = getTimeStamp();
-  xc_gga(
-    &gga_libxc, npoints, rho_libxc, sigma_libxc, zk_libxc, vrho_libxc, vsigma_libxc, v2rho2_libxc, v2rhosigma_libxc, v2sigma2_libxc,
-    v3rho3_libxc, v3rho2sigma_libxc, v3rhosigma2_libxc, v3sigma3_libxc, v4rho4_libxc, v4rho3sigma_libxc, v4rho2sigma2_libxc,
-    v4rhosigma3_libxc, v4sigma4_libxc
-  );
-  E = getTimeStamp();
-  fprintf(stderr, "GGA_X_PBE: %.4fs\n", E-S);
-
   if(xc_func_init(&gga_genxc, XC_GGA_X_BCGP_GENXC, XC_POLARIZED) < 0) {
     fprintf(stderr, "XC_GGA_X_BCGP_GENXC not found!\n");
     return -1;
@@ -141,6 +124,28 @@ int main() {
   E = getTimeStamp();
   fprintf(stderr, "GGA_X_PBE_GENXC: %.4fs\n", E-S);
 
+  if(xc_func_init(&gga_libxc, XC_GGA_X_BCGP, XC_POLARIZED) < 0) {
+    fprintf(stderr, "XC_GGA_X_BCGP not found!\n");
+    return -1;
+  }
+
+  for(i=0; i<npoints; i++){
+    rho_libxc[2*i + 0]   = 0.048 + i/(double)(npoints);
+    rho_libxc[2*i + 1]   = 0.025;
+    sigma_libxc[3*i + 0] = 0.0046;
+    sigma_libxc[3*i + 1] = 0.0044;
+    sigma_libxc[3*i + 2] = 0.0041;
+  }
+
+  S = getTimeStamp();
+  xc_gga(
+    &gga_libxc, npoints, rho_libxc, sigma_libxc, zk_libxc, vrho_libxc, vsigma_libxc, v2rho2_libxc, v2rhosigma_libxc, v2sigma2_libxc,
+    v3rho3_libxc, v3rho2sigma_libxc, v3rhosigma2_libxc, v3sigma3_libxc, v4rho4_libxc, v4rho3sigma_libxc, v4rho2sigma2_libxc,
+    v4rhosigma3_libxc, v4sigma4_libxc
+  );
+  E = getTimeStamp();
+  fprintf(stderr, "GGA_X_PBE: %.4fs\n", E-S);
+
   #define CHECK_CORRECTNESS(arr1,arr2,i);  if(!nearlyEqual(arr1[i], arr2[i])) { fprintf(stderr, "Results differ!\n"); return -1; }
   for(i = 0; i < npoints; i++) {
     CHECK_CORRECTNESS(rho_libxc, rho_genxc, 2 * i + 0);