Fix some bugs with reading data