Remove replacement from query