Fix suggested by Mathieu Malaterre: handle deprecated function