Fixed resource leak in batch convert