Fixed segmentation fault when arriving at last option.

Caused by attempt to access outside of the vector by improper
pointer arithmetic. vector.end() returns the address of the element
after the last. Changed to vector.end() - 1.