used ``_mexpand``
used ``_mexpand``; small change in ``check_solutions``
Merge pull request #2472 from pernici/dioph

used ``_mexpand``