fixed bugs, improved hc alloc, tried to make passthrough work, added cmd handler