Be more robust against unsaved files.