Fixed a few bugs with min_insertions