More fixes for meta data paths
diff --git a/lib/KorAP/Document.pm b/lib/KorAP/Document.pm
index 08aa2d0..4e648c3 100644
--- a/lib/KorAP/Document.pm
+++ b/lib/KorAP/Document.pm
@@ -10,7 +10,7 @@
 use KorAP::Log;
 use Mojo::DOM;
 use Data::Dumper;
-use File::Spec::Functions qw/catdir catfile splitdir/;
+use File::Spec::Functions qw/catdir catfile catpath splitdir splitpath rel2abs/;
 
 our @ATTR = qw/text_sigle
 	       doc_sigle
@@ -57,8 +57,11 @@
 sub new {
   my $class = shift;
   my $self = bless { @_ }, $class;
-  if (exists $self->{path} && $self->{path} !~ m!\/$!) {
-    $self->{path} .= '/';
+  if (exists $self->{path}) {
+    $self->{path} = rel2abs($self->{path});
+    if ($self->{path} !~ m!\/$!) {
+      $self->{path} .= '/';
+    };
   };
   return $self;
 };
@@ -121,11 +124,11 @@
     croak $unable;
   };
 
-  my @path = splitdir($self->path);
+  my @path = grep { $_ } splitdir($self->path);
   my @header;
 
   foreach (0..2) {
-    unshift @header, catfile(@path, 'header.xml');
+    unshift @header, '/' . catfile(@path, 'header.xml');
     pop @path;
   };
   my @type = qw/corpus doc text/;
diff --git a/t/real_goethe.t b/t/real_goethe.t
index 20addf1..14437f3 100644
--- a/t/real_goethe.t
+++ b/t/real_goethe.t
@@ -21,6 +21,7 @@
 
 # GOE/AGA/03828
 my $path = catdir(dirname(__FILE__), 'GOE/AGA/03828');
+# my $path = '/home/ndiewald/Repositories/korap/KorAP-sandbox/KorAP-lucene-indexer/t/GOE/AGA/03828';
 
 ok(my $doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
 ok($doc->parse, 'Parse document');
diff --git a/t/real_goethe_benchmark.t b/t/real_goethe_benchmark.t
index f119a2b..66152dd 100644
--- a/t/real_goethe_benchmark.t
+++ b/t/real_goethe_benchmark.t
@@ -4,6 +4,7 @@
 use strict;
 use warnings;
 use Test::More;
+use Mojo::ByteStream 'b';
 
 use Benchmark qw/:hireswallclock/;
 
@@ -19,6 +20,7 @@
 
 # GOE/AGA/03828
 my $path = catdir(dirname(__FILE__), 'GOE/AGA/03828');
+# Todo: Test with absolute path!
 
 ok(my $doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
 ok($doc->parse, 'Parse document');
@@ -50,18 +52,20 @@
 ok($tokens->add('CoreNLP', 'Morpho'),        'Add corenlp morpho');
 ok($tokens->add('CoreNLP', 'Constituency'),  'Add corenlp constituency');
 ok($tokens->add('Glemm', 'Morpho'),          'Add glemm morpho');
-ok($tokens->add('Connexor', 'Sentences'),    'Add cnx sentences');
-ok($tokens->add('Connexor', 'Morpho'),       'Add cnx morpho');
-ok($tokens->add('Connexor', 'Phrase'),       'Add cnx phrase');
-ok($tokens->add('Connexor', 'Syntax'),       'Add cnx syntax');
+# t ok($tokens->add('Connexor', 'Sentences'),    'Add cnx sentences');
+# t ok($tokens->add('Connexor', 'Morpho'),       'Add cnx morpho');
+# t ok($tokens->add('Connexor', 'Phrase'),       'Add cnx phrase');
+# t ok($tokens->add('Connexor', 'Syntax'),       'Add cnx syntax');
 ok($tokens->add('Mate', 'Morpho'),           'Add mate morpho');
 # $tokens->add('Mate', 'Dependency');
-ok($tokens->add('XIP', 'Sentences'),         'Add xip sentences');
-ok($tokens->add('XIP', 'Morpho'),            'Add xip morpho');
-ok($tokens->add('XIP', 'Constituency'),      'Add xip constituency');
+# t ok($tokens->add('XIP', 'Sentences'),         'Add xip sentences');
+# t ok($tokens->add('XIP', 'Morpho'),            'Add xip morpho');
+# t ok($tokens->add('XIP', 'Constituency'),      'Add xip constituency');
 # $tokens->add('XIP', 'Dependency');
 ok($tokens->to_json, 'To json');
 
 is($tokens->doc->to_hash->{title}, 'Autobiographische Einzelheiten');
 
+b($tokens->to_json)->spurt('AGA.03828.json');
+
 diag timestr(timediff(Benchmark->new, $t));