Fix deprecation warnings.

This seems to do the trick.