Fix device rebuild in case there is only one device
Rebuilding the only device is like rebuilding all the devices