Fixed some deprecation warnings