Fixed bug with selecting running instance

If there had been instances that were not running they would throw the
numbers off in the map and cause null pointeres.