Renamed fields for compatibility with UIDatePicker. Fixed several bugs.