Quick fix for issue with dirty tracking and record creation

Will add a test soon