Changed error correction to use Berlekamp-Massey.