Fixes some bugs with relative paths.