Improvements/fixes for modes csv|json|simple