Fix & optimize ReadPrefix