Minor fix in setExpirationHops

parameter overflow on various locations

Duplicate for my attempt in pull request #4423