Fixed bug with wrong sorting by time.