diff --git a/_oasis b/_oasis
index a0e3e5d93d122f30ac08e4fcde9b26c77ea8a91b..887a4b2b6f1659d9e9e8fcb717bbcc8f8426f369 100644
--- a/_oasis
+++ b/_oasis
@@ -1,6 +1,6 @@
 OASISFormat: 0.4
 Name:        lustre-v6
-Version:     1.689
+Version:     1.690
 Synopsis:    The Lustre V6 Verimag compiler
 Description: This package contains:
    (1) lus2lic: the (current) name of the compiler (and interpreter via -exec).
diff --git a/src/lv6version.ml b/src/lv6version.ml
index b208bf3d46b05e9f1b2faab7468948fe5dec7644..a7b13eadf07623cc7580b0a7cc277c89b87eed5b 100644
--- a/src/lv6version.ml
+++ b/src/lv6version.ml
@@ -1,7 +1,7 @@
 (** Automatically generated from Makefile *) 
 let tool = "lus2lic"
 let branch = "master"
-let commit = "689"
-let sha_1 = "d4fdee068416fe85a1809b1b47b93284d06bba32"
+let commit = "690"
+let sha_1 = "b207aa9d94a6bea80d498dc748401eea1130284c"
 let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")")
 let maintainer = "jahier@imag.fr"
diff --git a/src/soc2c.ml b/src/soc2c.ml
index 4a72a99436ae93609b92e1d8cebf6754ed5ba72b..09c32d14e1ed1e1be711693fe728a14a1ce719da 100644
--- a/src/soc2c.ml
+++ b/src/soc2c.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 05/05/2017 (at 14:16) by Erwan Jahier> *)
+(* Time-stamp: <modified the 05/05/2017 (at 15:38) by Erwan Jahier> *)
 
 
 (* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *)
@@ -876,6 +876,12 @@ let (f : Lv6MainArgs.t -> Soc.key -> Soc.tbl -> LicPrg.t -> unit) =
   let consts_c_oc = open_out "lustre_consts.c" in
   let cfiles_acc = ["lustre_consts.c"; cfile] in
   let const_def_h, const_def_c = constdef licprg in
+  let assign_ext_types_list = (Soc2cGenAssign.gen_used_types socs) in
+  let main_soc = Soc.SocMap.find msoc stbl in
+    (* Generate ext files if necessary  *)
+  let needs_cfile, needs_hfile = 
+    Soc2cExtern.gen_files main_soc stbl licprg ext_cfile ext_hfile hfile
+  in
   Lv6util.entete consts_h_oc "/*" "*/" ;
   output_string consts_h_oc const_def_h;
   Lv6util.entete consts_c_oc "/*" "*/" ;
@@ -895,7 +901,8 @@ typedef float _float;
 #define _true 1
 #endif
 // end of _SOC2C_PREDEF_TYPES
-// User typedef 
+"^(if needs_hfile then "#include \""^ base ^"_ext.h\"" else "")^
+"// User typedef 
 #ifndef _"^base^"_TYPES
 #define _"^base^"_TYPES\n");
     output_string types_h_oc (user_typedef licprg);
@@ -903,11 +910,6 @@ typedef float _float;
     try
     let putc s = output_string occ s in
     let puth s = output_string och s in
-    let main_soc = Soc.SocMap.find msoc stbl in
-    (* Generate ext files if necessary  *)
-    let needs_cfile, needs_hfile = 
-      Soc2cExtern.gen_files main_soc stbl licprg ext_cfile ext_hfile hfile
-    in
     Lv6util.entete occ "/*" "*/" ;
     Lv6util.entete och "/*" "*/";
     if Lv6MainArgs.global_opt.Lv6MainArgs.gen_wcet then (
@@ -947,13 +949,14 @@ typedef float _float;
     let cfiles_acc = List.fold_left (soc2c 2 och occ stbl msoc) cfiles_acc socs in
     
     puth "/////////////////////////////////////////////////\n";
-    let l = (Soc2cGenAssign.gen_used_types socs) in
-    if l <> [] then (
+    if assign_ext_types_list <> [] then (
       output_string types_h_oc "// Defining array and extern types assignments \n";
       if Lv6MainArgs.global_opt.Lv6MainArgs.gen_wcet then 
-        List.iter (fun t -> output_string types_h_oc (Soc2cGenAssign.f_forloop t)) l
+        List.iter (fun t -> output_string types_h_oc (Soc2cGenAssign.f_forloop t))
+                  assign_ext_types_list
       else
-        List.iter (fun t -> output_string types_h_oc (Soc2cGenAssign.f t)) l
+        List.iter (fun t -> output_string types_h_oc (Soc2cGenAssign.f t))
+                  assign_ext_types_list
     );
     puth "#endif\n";
     flush occ; close_out occ;
diff --git a/test/lus2lic.sum b/test/lus2lic.sum
index a3031811ca86acf55998b80ddf031dc8015a54fb..ac1fc321bbe9b355025f8d989e621a2c33b0b14b 100644
--- a/test/lus2lic.sum
+++ b/test/lus2lic.sum
@@ -1,5 +1,5 @@
 ==> lus2lic0.sum <==
-Test Run By jahier on Fri May  5 14:48:31 
+Test Run By jahier on Fri May  5 15:41:17 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic0 tests ===
@@ -64,7 +64,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
 XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
 
 ==> lus2lic1.sum <==
-Test Run By jahier on Fri May  5 14:48:32 
+Test Run By jahier on Fri May  5 15:41:18 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic1 tests ===
@@ -398,7 +398,7 @@ PASS: sh multipar.sh
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus  {}
 
 ==> lus2lic2.sum <==
-Test Run By jahier on Fri May  5 14:49:40 
+Test Run By jahier on Fri May  5 15:42:25 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic2 tests ===
@@ -738,7 +738,7 @@ PASS: sh zzz2.sh
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus  {}
 
 ==> lus2lic3.sum <==
-Test Run By jahier on Fri May  5 14:50:52 
+Test Run By jahier on Fri May  5 15:43:37 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic3 tests ===
@@ -1243,7 +1243,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
 
 
 ==> lus2lic4.sum <==
-Test Run By jahier on Fri May  5 14:52:50 
+Test Run By jahier on Fri May  5 15:45:35 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic4 tests ===
@@ -1760,14 +1760,14 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
 # of unexpected failures	6
 ===============================
 # Total number of failures: 23
-lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds
-lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 67 seconds
-lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 72 seconds
-lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 117 seconds
-lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 63 seconds
+lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 0 seconds
+lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 66 seconds
+lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 71 seconds
+lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 118 seconds
+lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 62 seconds
 * Ref time: 
-0.06user 0.01system 5:22.26elapsed 0%CPU (0avgtext+0avgdata 5584maxresident)k
-96inputs+0outputs (0major+6151minor)pagefaults 0swaps
+0.04user 0.03system 5:19.60elapsed 0%CPU (0avgtext+0avgdata 5604maxresident)k
+128inputs+0outputs (0major+6159minor)pagefaults 0swaps
 * Quick time (-j 4):
-0.07user 0.00system 2:03.28elapsed 0%CPU (0avgtext+0avgdata 5572maxresident)k
-160inputs+0outputs (0major+6170minor)pagefaults 0swaps
+0.05user 0.02system 2:01.94elapsed 0%CPU (0avgtext+0avgdata 5616maxresident)k
+64inputs+0outputs (0major+6157minor)pagefaults 0swaps