Bug fix and improved timestamps