updated date write tests
fixed some write related tests and removed debug code