Fix an oops in the device state collection API.