check_files: fixing bugs in open_shell_strem() function