Fix/heap

@calvinfo @harrietgrace