Fixed the date selection routines.