Fix potential error of bitshifting -1