Fix some invalid heap ops found by Dr Memory