Fix a bug, and add a test for Pow::is_canonical