Check (and canonicalize) dpid arguments to Switch()

This seems slightly ugly, but it has bitten many people.

Closes #268