Changed error correction to use Berlekamp-Massey. (fixed)