Minor fixes in IP connect and close commands