Added missing functions in heap memory. Some ASSERTS were corrected