Fix to_netcdf with 0d sting variables

Fixes #284