Finish first optimization rule: remove unnecessary calcs.

So far not activated, because test suite crashes.
Need to look into details.