Fixed saving projects that do not have any open files.
Fixed project switching to close all files when switching to a subdirectory.

Some of the files could have been left open if the name starts with
the name of a subdirectory the project is being switched to.