Fix for restore bug when a file cannot be opened.