Added -v flag for verbose logging control; special case handling of EOF errors.