Bugfixes in memory output