Thanks, it looks like $mid() had an internal maximum limit of 10000 vs the 10240 that $maxlenl returns. This issue has been fixed for the next version.