It looks like U++ int and int64 inside Value make mess.
In great number of cases, creating Value with int inside makes in Value<int64> instead. Which leads to assertion break while trying to process this Value. This is painfully and takes much time to debug.
I failed to find any conscious rules when int64 is generated instead of int. Take a look at this example:
int h = ValueTo<int>(StdConvertInt().Scan(ts.Left (delim)));
gives assertion error, because actually Value<int64> is generated.
Before I start investigating, can you make my life easier and post what is in "delim" ?
(Other than that, all numeric Values - bool, int, int64, doubl - are interconvertible. So it should not really matter what is the source type).