Fixed bug: terminate buffer.position