Embedded lock in history struct and fixed default --identity key location

Good point.