memory errors fixed in streaming and linear mmd