Fix implementation of create-device RPC