Fixed some bugs with new datepicker