Fixes #1454: refactored FileValidator.