Use replace line instead of insert if match for compatibility