Fixed problem with id being null when saving.