Improving debug() to-string() and chunk()