Manually merged contents of the file-dialog branch.