Enforce the right order for begin and end slice.

R=ozarov
DELTA=35 (33 added, 0 deleted, 2 changed)

Revision created by MOE tool push_codebase.
MOE_MIGRATION=7126