[range] Fix the return type of range::erase() and add tests.