Backport from HEAD. (Fixes error incorrect error message when formula-valued matrices are created.)
Changed paths: