diff,limit work with matrix input, bug #28