Fixed a bug in readVirtualMemory and writeVirtualMemory