Handle some base cases of matrix multiplication