Fixed #21587 -- Raised deprecation warnings correctly.