Fix bug when multiplying by a matrix.