Tweaks on tools.find_final

Fixed a typo in the loop fod find_final and increased the flexibility a little bit.