Throw TypeErrors in java #canonicalize and allow one or two parameter form, too.