Add regression tests for path replacement