Revert "calc 3.1 little fixes"

This reverts commit 5764366561fa1f54582429b884c54ae387634a37.
Revert "Revert "calc 3.1 little fixes""

This reverts commit 73f73bd44857dcb64430959da22b21dc7f8dd349.
Revert "Revert "Revert "calc 3.1 little fixes"""

This reverts commit d2ad5023f9be127dc673a6c86842cf16e8fecf47.