The last line in mobileplugin_switch() does drupal_goto(drupal_get_destination());. I think that is wrong, since the string returned is by get_destination may be "destination=node%2F1" which is not a reasonable path (it is intended for use in a querystring).

When the user navigates to http://example.net/mobileplugin/switch?destination=node%2F1 it still works, since the goto-function will fetch the destination from querystring by itself. But going to http://example.net/mobileplugin/switch (no destination set), which I expected to give the front page, causes an error in my case when redirecting to http://example.net/destination=
(We actually have an issue Microsoft ISA at our host, so I'm not sure how clearly this is noticed elsewhere.)

If the last line in mobileplugin_switch() is shortened to drupal_goto(); it works as I expected.
The bonus is that now I can set "m" as URL alias for "mobileplugin/switch" and inform users about this nice short URL.