Use a dynamic buffer for rendered SQL, instead of hardcoding 2048 bytes. Also,