Bug fixes for datepicker.