Fix ordering for devices