Add matrix tests