[#2144] To fix the deprecation warnings.