minor fix writeMemory()