Fixed the bug that caused an error reporting that no file has been selected when an incorrect file is loaded on top of a properly loaded file.