Fix Version numbers

The old implementation returned the same version number for all log entries of same id.