Fix compilation and use of deprecated features.