Improved decoding of affine-variety codes