fix some chunk reading bugs