bug fixes and improvements old-commit-hash: 36815cc6d536ab8926f6335574ea587947c4e222
export csv old-commit-hash: 5f045176775c8c2cdd7f85e7229f78cf26f0c013