Corrected a bug with variable device_files_dir