Fixed getting insert id for DB inserts.