Fix loop condition and early return conversion (find/map)