Adding matrix tests