#87 Fixed bugs in terminal resizing.