Proper dirty tracking in record updating

Fixes an issue of setting an attribute to `nil`