BUG: Fix not consolidating before to_csv (GH3624_)

closes #3624