Introduce check_file_extension flag