File dialogs and better error handling