Fixes insert_id to work correctly