use safe_reply, fix gist, and fix message length calculation