Fixes #1096. Check found before fs.stat