Read error correction in software