Error correction device and error correction method