Fix bug with broken timestamps on sessions
Add tests for migration 12