Fix path bugs

After almost a month of no commits to the master branch, here are some
fixes for path-related bugs.