Fixed issue with new entities incrementing their id by 2