Avoid undefined operation in rotation operations
merge of '19075b770dc61680a32bd34f961a0eca024062e9'
     and '6d38eeb5902175eca436b0314ec203974ace879d'