Fixes insert/overwrite mode