Fix wrong path when using basePath

Also renamed variables "files"/"file" -> "projectFiles"/"projectFile" to avoid confusion.