Replace overlapping commands