Fixed #49 using realpath and earlier index exists test.