added setCanonicalCode()
the canonical codes should be properly assigned now