Ok, the calculated fields are stored in mediafiles.jmd and I fixed my library editing the binary file directly. No general lessons there...
However, two features would be great to prevent an issue like this:
1) recursion check for calculated features (This was the problem).
2) import/export calculated fields to an editable format. The latter would also greatly reduce programming time for calculated features and will make them easier share.