Fix openDevice idx