Fix 'rot' primitive implementation.