Fixed broken tests and removed some deprecation warnings