fix core-dump while reading PLAIN_ENCODING; and fix readNewPage

fix readNewPage to return page instead of the last one