Fix some issues with time stamp logic