Added unit test for offline -s option, and fixed bug.

The option -s should point to next element to be executed.
That is, the element set by -s should be included in the
generated path.