Repaired strange heap bug