Fix computation of gradient packets in multidimensional case
Fix computation of gradient packets in multidimensional case

Note: The computed gradients (basis shape and coefficients) were NOT
wrong. But the option 'as_packet = True' failed for multidimensional
packets.

WaveBlocks/WaveBlocksND,WaveBlocks/WaveBlocksND