Fix bug in datamatrix.jl

Add systematic test coverage