Datepicker bug fixes

Fixes back button bug and bug where dates wouldn't clear correctly.