- fix code to not modify the const buffer (grrr...)