Add guards to ean13 encoding