Fixed several deprecation warnings