some heap corrections