Fixed publish to handle timestamps correctly