This reverts commit 6fdfc81287 to fix the check in the assert )need to use end, nod begin function).
6fdfc81287