Fix safe variable printing when CANONICAL_VARIABLES is defined.