Bugfix: Avoid getting stuck when the first datapoint has a NaN value