Fixed serious performance issue in MemoryReader