Count operations

It seems that in few places the count of operations is not representative of what the code does. This needs to be checked and fixed if needed.