Fixed HeapAlloc() bug