Fix infinite loop for month and year drop down. #1248