fix folds; autowrite