Import fixes and a small terminal size handling fix