Fixed small bug in index that didn't return -1 when needed