Fixed cast order in linear read()