Account for two levels of symlinks

Also, remove the double slash from the output dir.