Casts to avoid compiler warnings in edit-distance-*