Fix encoding with only end time