Fix wrong end date output