Fix character buffer reading