#12 (temporarily) fixes empty command generated at the end of replace function