Fix bug in time