Merge "Revert "Revert "Change invalid input exception to IllegalArgumentException."""