Fix: Replace mode should only replace first encountered instance