Fix time_quote_ends bugs