Fixed AOOBE.
Fixed another AOOBE.
Revert.
Fixed dead lock on resize. We don't need to lock terminal on reading buffer.
Cleanup.