Some fixes for issues from hanatos review
Refactor histogram-related things a bit
Note that commit_params_late is less safe than commit_params