MakeFlat NaN issue work around