Fixed buffer readPos spoiling bug