Fixed almost all deprecation warnings