Fix deprecated use of ~