Perform file check by direct reference

Fixes #468