Bug fixes. Add more comments.
Increment internal eventId after each insertion.
Add statistics source code.