Attempt to create mask to remove trailing ones

Arithmetic right shifts can leave trailing 1s.