Fix use of old API