Getting rid of nans before plotting histogram.