Fix on DeprecationWarning handling