Fixes #810.
Merge pull request #811 from mohawkjohn/vector_erase_end

Fixes undefined behavior from erasing an end iterator