Fix index checks in get/put functions (jessicah)