Replace use of .delete by :delete or .delete_key as appropriate