Use `path.join` properly and in more places.