Fixed input issues, broke CSV write