Fix extract command writing