Reworked handling of device ready.