Fix paths

Based on the changes of @rickbergfalk: I changed it back to using `path.join` to be able to handle relative paths as well. Afterwards all slashes are replaced.