Fix double slash replacement to use correct parts