Corrected leap year condition in getMonths()