Check for number type first (data[1] could be nil for grid).