Fixing performance regressions in ham_bench