Get rid of tildes because they would have broken sort order.

E.g. "/1/30" is smaller than "/1/3~1", so the order between those two
would be swapped.