Improve hcub code quality and debuggability
We should make it safer memory-wise (e.g. array bounds) and message/debuggability-wise (e.g. why and where does the routine fail).
We should make it safer memory-wise (e.g. array bounds) and message/debuggability-wise (e.g. why and where does the routine fail).