Fixed bug #281: heap truncation fails. Problem was thattermid parameter