Fix bug when year and month are 0.