Avoid overflow

Change-Id: Ia80682aeb87225b9bde7398186e121b1d3bdc2ad