various bug fixes in datepicker