Added a fix for deprecation warnings