fix bug constructing MemoryRef