Avoid undefined left shift of negative values

Change-Id: I428b2401f59930e115f4b0d205f6c1db779b16f9