Merge "Fix and improve shift and rotate operations."