Eliminate (most of) deprecation warnings.