Fix for deprecation warnings