Correct relative file handling of directory strucutre. Not beautiful, but working well.