[WIP] Fix ht interface

Resubmit from #105 onto master