fix bugs with instruction & reg insertion