Fix improper coding

long instead of int for productId and Debug.LogWarning must come before
an exception is thrown.