path fixes

Makes script work, but a bit brittle. @jarv