filter non-directory versions
handle directory when getting source file Fix #876