Fix regression in canonicalize