fix: grind canonicalizer

This PR fixes an incorrect optimization in the `grind`
canonicalizer. See new test for an example that exposes the problem.
3 files changed