Add code to replace NaNs with zeros