Bugfix in file check