Merge "Fix an overflow issue for HBD" into nextgenv2