Fixed bug #79132 Following cmb's suggestion and replacing the counter with a check against the bound_params HT, which ensures that both cannot go out of sync.