Fix auto replace errors