Implemented upheap(), and changed the heap_free() function to set the passed heap object to NULL