Simple external error correction. Code cleaning.