Fix invalid DIR parameter passed to `read-file-name'

Also ensure that the project file exists.