Fixed crash when trying to position to invalid iterator