Small bugfixes.
Changed to the new method to register devices.