Add more checks.
Add matrix wrapper.