Fixes a bunch of path-related issues.