Fixed issue with double disposing of a buffer.