fix remaining TERM setting bugs