Fixed bug in memory system