Runmode unittest fix

Here's a small patchset containing fixes for the unit test system. For a few protocols, the tests were run twice because the registration was done twice.