Fixed issue with buffers being garbage collected before being used.