Bug fix in memory