fix some further issues with string truncation and undersized buffers. (NicJA)