Small bug fix for iterating the dimensions in toCSV.