strip empty entries from sources on the way in

For #709