bugfix for ace and python3 compatibility when reading less than all the data