Correction from Nichola Gelmini - correct freeing of buffers with the proper delete operator