Added more tests. Handled the case when you add a record with a single transient element (it is not being saved since this commit).