Allow Record.duration to be null

It wasn't possible to create new records because duration field was set to be not null.
This commit fixes that bug.