Fixed error with null id when save new Record.