fix some invalid reads