Fixed issue with events not generating id+1 in tables.