Fix session id generation.
Updates history