Many minor changes

Fixed to check for filepaths when selecting documents.