Auto refactoring bug fixed