SSP-1994 Guard against bad codes when printing templates