Expand the path before testing if it exists

This allows the path to have the '~' tilde for the home directory, such as: "~/my/file".