Fix source guessing