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

Fixes undefined behavior from erasing an end iterator
Fixing issue 812
Merge pull request #813 from QuentinDeroubax/FixingIssue812

Fixes #812