Fixed a bug with device registration.