Some more fixes for datetime