Using first valid format when parsing multiple formats - #653 #788