h3d fixes / heaps js port