Bugfixes and netcdf stuff