Fixed rule for checking that filename is valid.