Fixed BasisSumFunction to handle vector and tensor valued bases.