Fixed bug that crashed the client on terminal resizing due to wrongly expecting there always to be one active window.