Fixed bug of dereferencing past-the-end iterator in resolver