Fixed typo.
Updated for an incompatible API change.
Fixed deprecation warnings.