Bugfix for filling measurements

No more heap corruption in debug mode
Merge branch 'tamas'