Cure a subtle bug

Setting scope.a = scope.a % ctrl.n lets the lvalue get modified when
ctrl.n has not been set to its final value yet. In general, let's avoid
modifying variables set from attributes