Use appendStringInfoChar instead of the macro version
Small fixes
Use StringInfo instead of mbuf