Fixed some deprecation warnings

Fixed some deprecation warnings