Fixed bug in memblock: blocks not terminated correctly when appending blocks