Fix problem if device has invalid time.