Console select fix

Sorry, last pull request added a previous commit from TorbenC, trying again.

This fixes the console selection.  Before, when the console was closed, it would remove the reference to whatever was selected.  Now the console remembers the previous selection when it is opened again.

Thanks to TorbenC for helping with this.