Fix path handling in `core download`

#320 exposed a bug in `core download`, as well as a weakness in the way the functional tests are run.