  set arg0 [lindex $argv 0]
  if [regexp {\.tcl$} $arg0] {
  	if [file exists $arg0] {
-@@ -91,10 +101,8 @@ if {![regexp {(.*?):.*$} $arg1 d device]} {
- }
- set flags(logwrite) 1
+@@ -115,10 +125,8 @@ if {![regexp {(.*?):.*$} $arg1 d device]
+ 	}
+ }
  
 -set setup(dbdir) /usr/share/usb_modeswitch
 -set setup(dbdir_etc) /etc/usb_modeswitch.d

 	SafeExit
 }
 
@@ -261,7 +269,7 @@ if {$config(NoMBIMCheck)==0 && $usb(bNumConfigurations) > 1} {
 	if [CheckMBIM] {
 		Log " driver for MBIM devices is available"
 		Log "Find MBIM configuration number ..."

 			Log "Error when trying to find MBIM configuration, switch to legacy modem mode"
 		} else {
 			set cfgno [string trim $cfgno]
@@ -321,7 +329,7 @@ if {$report == ""} {
 	# Now we are actually switching
 	if $flags(logging) {
 		Log "Command line:\nusb_modeswitch -W -D $configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f \$flags(config)"
