Fix: "*" was being appended to sources too often

The while loop construction was actually yielding false positives due to the placement of parentheses, and would append an "*" to sources even when unnecessary.