Fixing the use of null primary key for insert queries.