small fixes in looking for index