Implement more correct/complete file chooser behaviour