Terminal bug fixes