fix test_safe_heap