Fix remainingBits to align correctly