Replace deprecated function calls in examples