Correct print_heap function