small fixes to data reading