Fixed tostring to output appropriate context length