bugfix for datamatrix error correction

more tests and code cleanup