Fix upc validation to check for nil