NetCDF segfault fix