Fixing database issue.

_find_index was not iterating properly on path