[Bug] When searching for existing windows when it doesn't exist

Fixed issue where we can fail to find the previously selected window and
then select a window that doesn't exist.