fix replacement in edge case with NULL integer fields in a table without a primary key