Make the surface plot mode work with nans (replace by zeros)