Fixed bug in writeMem.ReadFrom which didn't increase the position correctly. Added test.