diff --git a/UD_any/config b/UD_any/config
new file mode 100644
index 0000000000000000000000000000000000000000..3930e6064ebd56522b9c6701a4f37bba1e42f58b
--- /dev/null
+++ b/UD_any/config
@@ -0,0 +1 @@
+UD_ROOT=~/Downloads/ud/ud-treebanks-all/
diff --git a/UD_any/data/Makefile b/UD_any/data/Makefile
index 574ebf8b1ea5d4d07fa7aac7971403e587a721dc..dbd64f5c1fcc976c560ac75146d3541d1484b14b 100644
--- a/UD_any/data/Makefile
+++ b/UD_any/data/Makefile
@@ -1,5 +1,6 @@
+include ../config
+
 TOOLS=../../tools
-UD_ROOT=~/Downloads/ud/ud-treebanks-all/
 CONLL2TXT=$(TOOLS)/conll2text.py
 MCD=conllu.mcd
 
diff --git a/UD_any/train.sh b/UD_any/train.sh
index de8f519d62230a016e731760f91883446e08fd43..dc9b25b025b67b68bd905aadd79ded6d1c94456e 100755
--- a/UD_any/train.sh
+++ b/UD_any/train.sh
@@ -1,5 +1,7 @@
 #! /bin/bash
 
+source config
+
 function has_space {
   [[ "$1" != "${1%[[:space:]]*}" ]] && return 0 || return 1
 }
@@ -11,7 +13,6 @@ function print_usage_and_exit {
 
 LANG=UD_any
 LANGPATH=$MACAON_DIR/$LANG
-UD_ROOT=~/Downloads/ud/ud-treebanks-all/
 MCD=$LANGPATH/data/conllu.mcd
 KEYWORD=$1
 TEMPLATENAME=$2
diff --git a/tools/fplm2fP.py b/tools/fplm2fP.py
index 5a2c12e0a8e27c65fbdf49017f958bc1be86556e..e83a8516159a73ee026518190faa10a918ace367 100755
--- a/tools/fplm2fP.py
+++ b/tools/fplm2fP.py
@@ -22,8 +22,11 @@ form2pos = {}
 int2form = {}
 pos2int = {}
 int2pos = {}
+
 while(len(line) != 4) :
   line = getLineAsList(fplm)
+  if len(line) == 0 :
+    exit(1)
 
 while(len(line) == 4) :
   form = line[0].strip()