added netcdf and hdf5, fixed two minor bugs elsewhere