Fix possible issue with latest number detection