More robust file selection.