Fix record creation if data is nil.