Corrected two deprecation warnings