Fix get fields if defined
Fix write date