Fixed date handling and date conversions
Generics cleanup