Fixed bug in sum reduction function causing exceptions, optimised stem only works if number of pixels in x is multiple of the number of simultaneous wavefunctions (multistem)