Fix deprecated method warnings