diff --git a/CMakeLists.txt b/CMakeLists.txt
index c53a8c10b189a89a2658c7ffad2911f7282c2bd9..80f3d0f2f62b26d9642eff864c8168a89de3dbc2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,7 @@ project(macaon2)
 
 find_package(FLEX)
 find_package(BLAS)
+find_package(DyNet)
 
 add_definitions("-Wall" )
 SET(CMAKE_C_COMPILER g++)
diff --git a/maca_common/include/word.h b/maca_common/include/word.h
index 7e8f30bdbb048ac2767d692d1cbc182fc3ed0c99..51b962200a24538c1c2840906ec3585735aad827 100644
--- a/maca_common/include/word.h
+++ b/maca_common/include/word.h
@@ -59,7 +59,7 @@ typedef struct _word {
 #define word_get_cpos(w)           (((w) == NULL) ? -1 : (w)->wf_array[MCD_WF_CPOS])
 #define word_get_pos(w)            (((w) == NULL) ? -1 : (w)->wf_array[MCD_WF_POS])
 #define word_get_feats(w)          (((w) == NULL) ? -1 : (w)->wf_array[MCD_WF_FEATS])
-#define word_get_gov(w)            (((w) == NULL) ?  0 : (w)->wf_array[MCD_WF_GOV])
+#define word_get_gov(w)            (((w) == NULL) ?  WORD_INVALID_GOV : (w)->wf_array[MCD_WF_GOV])
 #define word_get_label(w)          (((w) == NULL) ? -1 : (w)->wf_array[MCD_WF_LABEL])
 #define word_get_stag(w)           (((w) == NULL) ? -1 : (w)->wf_array[MCD_WF_STAG])
 #define word_get_sent_seg(w)       (((w) == NULL) ?  0 : (w)->wf_array[MCD_WF_SENT_SEG])
diff --git a/maca_trans_parser/src/movements.c b/maca_trans_parser/src/movements.c
index 1107e7910260cd07e012d013fb079ab608340fbd..6c2f280bf3d0379f87715c3bdd3e56b3d817a275 100644
--- a/maca_trans_parser/src/movements.c
+++ b/maca_trans_parser/src/movements.c
@@ -4,33 +4,6 @@
 #include"util.h"
 #include"movements.h"
 
-int movement_eos(config *c, int movement_code)
-{
-  if(stack_is_empty(config_get_stack(c))) return 0;
-  word *s0 = stack_top(config_get_stack(c));
-
-  /* word on top of stack is already eos */
-  if(word_get_sent_seg(s0) == 1) return 0;
-  
-  /* set word on the top of the stack to eos */
-  word_set_sent_seg(s0, 1); 
-
-  config_push_mvt(c, movement_code, s0, NULL);
-    
-  return 1;
-}
-
-int movement_eos_undo(config *c)
-{
-  word *gov = mvt_get_gov(mvt_stack_top(config_get_history(c)));
-  
-  /* word on the top of the stack is not eos anymore */
-  word_set_sent_seg(gov, 0); 
-
-  mvt_free(config_pop_mvt(c));
-  return 1;
-}
-
 int movement_left_arc(config *c, int movement_code, int label)
 {
   if(stack_is_empty(config_get_stack(c))) return 0;  
@@ -158,8 +131,9 @@ int movement_root(config *c, int movement_code, int root_code)
   s0->is_root = 1;
 
   /*---- ajout 19/12/17 ----------*/
-  //   word_set_sent_seg(word_buffer_get_word_n(config_get_buffer(c), s0->rspan), 1); 
+  //     word_set_sent_seg(word_buffer_get_word_n(config_get_buffer(c), s0->rspan), 1); 
   /*-----------------------------*/
+
   stack_pop(config_get_stack(c));
 
   config_push_mvt(c, movement_code, s0, NULL);
@@ -179,6 +153,32 @@ int movement_root_undo(config *c)
   return 1;
 }
 
+int movement_eos(config *c, int movement_code)
+{
+  if(stack_is_empty(config_get_stack(c))) return 0;
+  word *s0 = stack_top(config_get_stack(c));
+
+  /* word on top of stack is already eos */
+  if(word_get_sent_seg(s0) == 1) return 0;
+  
+  /* set word on the top of the stack to eos */
+  word_set_sent_seg(s0, 1); 
+  stack_pop(config_get_stack(c));
+  config_push_mvt(c, movement_code, s0, NULL);
+  return 1;
+}
+
+int movement_eos_undo(config *c)
+{
+  word *gov = mvt_get_gov(mvt_stack_top(config_get_history(c)));
+  
+  /* word on the top of the stack is not eos anymore */
+  word_set_sent_seg(gov, 0); 
+
+  mvt_free(config_pop_mvt(c));
+  return 1;
+}
+
 int movement_add_pos(config *c, int movement_code, int pos)
 {
   if(word_buffer_b0(config_get_buffer(c)) == NULL) return 0;
diff --git a/maca_trans_parser/src/oracle_parser_arc_eager.c b/maca_trans_parser/src/oracle_parser_arc_eager.c
index 7a34fcdca157840a9f270cca723c3c17ddc067db..e4aae787c960e5874ac87422af876ab9ae51db64 100644
--- a/maca_trans_parser/src/oracle_parser_arc_eager.c
+++ b/maca_trans_parser/src/oracle_parser_arc_eager.c
@@ -61,17 +61,20 @@ int oracle_parser_arc_eager(config *c, word_buffer *ref, int root_label)
 	  printf("dans ref gov de b0 (%d) = %d\n", b0_index, b0_gov_index);*/
 
     /* s0 is the root of the sentence */
-    /*    if((s0_label == root_label)
-       && check_all_dependents_of_word_in_ref_are_in_hyp(c, ref, s0_index)
+    if((s0_label == root_label)
+       //       && (word_get_label(word_buffer_get_word_n(config_get_buffer(c), s0_index)) != root_label)
+              && check_all_dependents_of_word_in_ref_are_in_hyp(c, ref, s0_index)
        ){
       return MVT_PARSER_ROOT;
-      }*/
-
+    }
+    
     /* word on the top of the stack is an end of sentence marker */
     if((word_get_sent_seg(word_buffer_get_word_n(ref, s0_index)) == 1)
-       && (word_get_sent_seg(word_buffer_get_word_n(config_get_buffer(c), s0_index)) != 1)){
+       //       && (word_get_sent_seg(word_buffer_get_word_n(config_get_buffer(c), s0_index)) != 1)
+              && check_all_dependents_of_word_in_ref_are_in_hyp(c, ref, s0_index)
+       ){
       return MVT_PARSER_EOS;
-      }
+    }
     /* LEFT ARC  b0 is the governor and s0 the dependent */
     if(s0_gov_index == b0_index){
       return movement_parser_left_code(word_get_label(word_buffer_get_word_n(ref, s0_index)));