Fix a buffer size bug
Fix multiline truncation bug