fixed singleswitch.pl and some more

Not tested