Fix bug in find packed object.

Fixes #2650 
@ussuri 
The end range is not inclusive.