Fix deprecated function wrapping