Fix check of valid_for_publication flag