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