Fix of memory leak

Fixes #1265 (probably)

freeing data in expanded ensemble code that should have been freed all along.

Change-Id: I115ee068c56e4edab8fcea828e60ee1386f00716