Fix bug in time selection.