Fix for episode duration NaN problem.