fix demos to work with new assertAllocated() lines in writeMem