#181 buffer.slice overflow fix