Subtle bug in target time calculation