To-CSV script; misc tweaks