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.
Merge pull request #316 from Taytay/patch-1

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