Fix a class cast and make dates correct