Check status of lookup_path_in_* functions
Remove unused vars and fix signed vs unsigned comparison issues
Fix check for iterations - missing a star